<div class="page-header">
	<%= link_to "<i class='icon-pencil'></i>&nbsp;Edit".html_safe, edit_campaign_url(@campaign), :class => "btn" %>
	<%= link_to "<i class='icon-home icon-white'></i>&nbsp;Home".html_safe, campaigns_url, :class => "btn btn-primary" %>
	<h1>Campaign - <%= @campaign.name %>&nbsp;<small><abbr title="Append this to the end of each link used in this campaign e.g. http://yourdomain.com/?cid=1">?cid=<%= @campaign.id %></abbr></small></h1>
</div><!-- eo .page-header -->

<section id="campaign-info">
	<% if @campaign.end_date < Date.today %>
		<p class="ended">This campaign has ended.</p>
	<% else %>
		<p class="running">This campaign is currently running.</p>
	<% end %>
</section><!-- #campaign-info -->

<section id="financials" class="stats">
	<h3>Campaign Spend: <span><%= Touchstone.currency %><%= sprintf("%.2f", @campaign.spend_amount) %></span></h3> 
	<h3>Campaign Revenue: <span><%= Touchstone.currency %><%= sprintf("%.2f", @campaign.revenue) %></span></h3>
	<h3>Return on investment: <span><%= sprintf("%.2f", @campaign.roi) %>%</span></h3>
</section>

<section id="visits" class="stats">
	<h3>Unique Campaign Visits: <span><%= @campaign.visits %></span></h3>
	<h3>Conversion Rate: <span><%= sprintf("%.2f",@campaign.conversion_rate) %>%</span></h3>
</section>

<h2>Signups via this campaign</h2>

<table class="table table-striped">
	<thead>
		<tr>
			<%= signups_table_headers(@columns) %>
		</tr>
	</thead>
	<tbody>
	<% @campaign.campaign_signups.each do |signup| %>
		<tr>
			<%= signups_table_content(@columns,signup)%>
		</tr>
	<% end %>
	</tbody>
</table>